﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

namespace FireBillBook.DbMigrations.DevPgsqlMigrations
{
    public partial class AddBillingSourceData : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BillingSourceDatas",
                columns: table => new
                {
                    DataId = table.Column<int>(nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    IsHandled = table.Column<bool>(nullable: false),
                    DataSourceCode = table.Column<string>(nullable: true),
                    TradingCode = table.Column<string>(nullable: true),
                    OrderCode = table.Column<string>(nullable: true),
                    TradingParty = table.Column<string>(nullable: true),
                    ItemName = table.Column<string>(nullable: true),
                    IncomeOrSpend = table.Column<int>(nullable: false),
                    Amount = table.Column<string>(nullable: true),
                    TradingStatus = table.Column<string>(nullable: true),
                    TradingTime = table.Column<DateTime>(nullable: false),
                    Remark = table.Column<string>(nullable: true),
                    ExternalData = table.Column<string>(nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BillingSourceDatas", x => x.DataId);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BillingSourceDatas");
        }
    }
}
